/**
 * Copyright (C) 2013-2015
 *
 * @file   S_2_Lock_doChange.c
 *
 * @remark
 *
 */

#include "S_2_Lock_doChange.h"
#include "miio_user_api.h"
#include "iid.h"


void P_2_7_Anti_Lock_doChange(bool newValue)
{
    if (get_mi_authorization()==UNAUTHORIZATION ||
        miio_gatt_property_changed(2, 7, property_value_new_boolean(newValue)) != 0)
    {
        MI_LOG_ERROR("send_property_changed failed!\n");
    }
}


void P_2_8_Child_Lock_doChange(bool newValue)
{
    if (get_mi_authorization()==UNAUTHORIZATION ||
        miio_gatt_property_changed(2, 8, property_value_new_boolean(newValue)) != 0)
    {
        MI_LOG_ERROR("send_property_changed failed!\n");
    }
}


void P_2_9_Button_Function_doChange(uint8_t newValue)
{
    if (get_mi_authorization()==UNAUTHORIZATION ||
        miio_gatt_property_changed(2, 9, property_value_new_uchar(newValue)) != 0)
    {
        MI_LOG_ERROR("send_property_changed failed!\n");
    }
}

void P_2_10_Away_Home_Mode_doChange(bool newValue)
{
    if (get_mi_authorization()==UNAUTHORIZATION ||
        miio_gatt_property_changed(2, 10, property_value_new_boolean(newValue)) != 0)
    {
        MI_LOG_ERROR("send_property_changed failed!\n");
    }
}


void P_2_11_Two_Step_Verification_doChange(bool newValue)
{
    if (get_mi_authorization()==UNAUTHORIZATION ||
        miio_gatt_property_changed(2, 11, property_value_new_boolean(newValue)) != 0)
    {
        MI_LOG_ERROR("send_property_changed failed!\n");
    }
}
